<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>PHP留言本程序</title>
    <link type="text/css" rel="stylesheet" href="./Public/css/bootstrap.css"/>
    <script language="JavaScript" src="./Public/js/jquery-2.0.3.min.js"></script>
    <script language="JavaScript" src="./Public/js/bootstrap.js"></script>
    <style>
        body{
            padding-top:80px;
            background:#EDEFF0;
        }
        h1{
            text-align:center;
        }
        .bgwhite{
            background:#fff;
            padding:15px;
            border-radius:3px;
        }
        .mb15{
            margin-bottom:15px;

        }
        .meslist h3{
            border-bottom:1px solid #eee;
            padding-bottom:10px;
            font-size:16px;
        }
        .meslist h3 span{
            margin-right:10px;
        }
        .meslist a{
            float:right;
            margin-left:15px;
            display:none;
            -moz-transition: all 0.3s ease-in; -webkit-transition: all 0.3s ease-in; -o-transition: all 0.3s ease-in;transition: all 0.3s ease-in
        }
        .meslist:hover a{
            display:block;
        }
        .alert{
            line-height:30px;
        }
        .time{
            float:right;
        }
    </style>

</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="container">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="Index.php">PHP多用户微博系统</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav navbar-right">
                    <?php if(isset($_SESSION [ 'username' ])){ ?>
                    <li><a href="#" data-toggle="modal" data-target="#myModal">欢迎你：<?echo $_SESSION [ 'username' ]?></a></li>
                    <?}else{?>
                    <li><a href="#" data-toggle="modal" data-target="#myModal">注册</a></li>
                    <li><a href="#" data-toggle="modal" data-target="#myModal1">登录</a></li>
                    <?}?>
                    <?php if(isset($_SESSION [ 'username' ])){ ?>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">用户中心<span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">我的留言</a></li>
                            <li><a href="#">我的评论</a></li>
                            <li><a href="#">我的资料</a></li>
                            <li><a href="#">我的博客</a></li>
                            <li><a href="Index.php?c=User&a=Logout">用户退出</a></li>
                        </ul>
                    </li>
                    <?}?>
                </ul>
            </div><!-- /.navbar-collapse -->
        </div>
    </div><!-- /.container-fluid -->
</nav>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">用户注册</h4>
            </div>
            <div class="modal-body">
                <form action="Index.php?c=User&a=Regsiter" method="post">
                    <div class="form-group">
                        <label for="exampleInputEmail1">用户昵称</label>
                        <input type="text" class="form-control" id="exampleInputEmail1" placeholder="请输入你的昵称" name="username">
                        <input type="hidden" name="regTime" value="<?php echo time();?>">
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail1">密&nbsp;码</label>
                        <input type="password" class="form-control" id="exampleInputEmail1"  name="password">
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail1">邮&nbsp;箱</label>
                        <input type="email" class="form-control" id="exampleInputEmail1"  name="email" placeholder="请输入你的邮箱">
                    </div>
                    <button type="submit" class="btn btn-success btn-block btn-lg">注册</button>
                    <!--<button type="button" class="btn btn-danger" data-dismiss="modal">取消</button>-->
                </form>
            </div>
            <div class="modal-footer">
                PHP留言程序 [Powered by YiMingJiang]
            </div>
        </div>
    </div>
</div>

<!-- Modal -->
<div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">用户登录</h4>
            </div>
            <div class="modal-body">
                <form action="Index.php?c=User&a=Login" method="post">
                    <div class="form-group">
                        <label for="exampleInputEmail1">用户名</label>
                        <input type="text" class="form-control" id="exampleInputEmail1" placeholder="请输入你的昵称" name="username">
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail1">密&nbsp;码</label>
                        <input type="password" class="form-control" id="exampleInputEmail1"  name="password">
                    </div>
                    <button type="submit" class="btn btn-info btn-block btn-lg">登录</button>
                    <!--<button type="button" class="btn btn-danger" data-dismiss="modal">取消</button>-->
                </form>
            </div>
            <div class="modal-footer">
                PHP留言程序 [Powered by YiMingJiang]
            </div>
        </div>
    </div>
</div>

<div class="container">
    <div class="row">
        <div class="col-md-4 bgwhite" id="myform">
            <h3>用户列表</h3>
        </div>

        <div class="col-md-8">
            <div class="col-sm-12 col-md-12 bgwhite">
                <h3><? echo $data['title']?><span class="time"><? echo date('Y-m-d H:i:s',$data['addTime'])?></span></h3>
                <div class="alert alert-success" role="alert"><? echo $data['content']?></div>
            </div>
        </div>

    </div>
</body>
</html>